<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('正式服务商列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label style="width:100px">服务商编号：</label>
                            <input type="text" name="agentNum"/>
                        </li>
                        <li>
                            <label style="width:100px">服务商名称：</label>
                            <input type="text" name="agentName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
  var prefix = ctx + "terminal/changeFeeRecord";
  var datas = [[${@dict.getType('agent_status')}]];
  $(function() {
    var options = {
      url: prefix + "/getAgentInfoList",
      modalName: "正式服务商查找带回",
      showSearch: false,
      showRefresh: false,
      showToggle: false,
      showColumns: false,
      rememberSelected: true,
      columns: [{
        field: 'state',
        radio: true
      },
      {
        field: 'agentNum',
        title: '服务商编号'
      },
      {
        field: 'agentName',
        title: '服务商名称'
      },
      {
        field: 'grade',
        title: '挡位'
      },
      {
          field: 'localdate',
          title: '添加时间'
      }
      ]
    };
    $.table.init(options);
  });
  function submitHandler(index, layero) {
    var rows = $.table.selectFirstColumns();
    if (rows.length == 0) {
      $.modal.alertWarning("请选择一条记录");
      return;
    }
    $.modal.close();
    // 父页面的变量
    parent.$('#agentNum').val($.table.selectColumns("agentNum"));
    parent.$('#agentName').val($.table.selectColumns("agentName"));
  }

</script>
</body>
</html>
